package a.f.l;

import a.c.d;
import a.c.k;
import a.c.q;
import a.d.w;
import a.f.ad;
import a.f.cd;

import java.util.ArrayList;
import java.util.Collection;

final class o
{
  public static Collection a(q paramq, d paramd, boolean paramBoolean)
  {
    Object localObject = paramBoolean ? ad.q : ad.r;
    k localk = paramq.c(localObject);
    Collection localCollection = null;
    if ((g.Cc != 0) || (localk != null)) {
      localCollection = (Collection)localk.get(paramd);
    }
    return localCollection;
  }
  
  public static Collection c(q paramq, d paramd, boolean paramBoolean)
  {
    int i = g.Cc;
    Object localObject1 = paramBoolean ? ad.q : ad.r;
    k localk = paramq.c(localObject1);
    Object localObject2 = null;
    if ((i != 0) || (localk != null))
    {
      localObject2 = (Collection)localk.get(paramd);
      if (i != 0) {
        break label75;
      }
      if (localObject2 != null) {
        localObject2 = new ArrayList((Collection)localObject2);
      }
    }
    label75:
    return localObject2;
  }
  
  public static void a(a.f.o paramo, d paramd, Collection paramCollection1, Collection paramCollection2)
  {
    int n = g.Cc;
    int m = g.Bc;
    if (!paramd.g()) {
      return;
    }
    if (n == 0) {
      if (paramCollection1 == null) {
        paramCollection1 = new ArrayList(1);
      }
    }
    if (n == 0) {
      if (paramCollection1.isEmpty())
      {
        if (n != 0) {
          break label82;
        }
        localad1 = ad.b(255);
        if (m == 0) {
          break label84;
        }
      }
    }
    label82:
    ad localad1 = (ad)paramCollection1.iterator().next();
    label84:
    if (n == 0) {
      if (paramCollection2 == null) {
        paramCollection2 = new ArrayList(1);
      }
    }
    if (n == 0) {
      if (paramCollection2.isEmpty())
      {
        localad2 = ad.b(255);
        if (n != 0) {
          break label157;
        }
        if (m == 0) {
          break label150;
        }
      }
    }
    ad localad2 = (ad)paramCollection2.iterator().next();
    label150:
    label157:
    if (n == 0) {
      if (a(localad1, localad2))
      {
        boolean[] arrayOfBoolean1 = a(localad1.a());
        boolean[] arrayOfBoolean2 = a(localad2.a());
        int i;
        label251:
        int j;
        int k;
        if (n == 0)
        {
          if (b(arrayOfBoolean1) > b(arrayOfBoolean2))
          {
            i = 0;
            if (i < arrayOfBoolean2.length) {}
            while (n != 0)
            {
              if (m != 0) {
                break label264;
              }
              if (arrayOfBoolean1[i] != 0)
              {
                if (n != 0) {
                  break label251;
                }
                if (arrayOfBoolean2[i] != 0) {
                  arrayOfBoolean1[i] = false;
                }
              }
              i++;
              if (m == 0) {
                break;
              }
            }
            if (b(arrayOfBoolean1) == 0)
            {
              i = 0;
              do
              {
                if (i >= arrayOfBoolean2.length) {
                  break;
                }
                j = arrayOfBoolean2[i];
                if (n != 0) {
                  return;
                }
                if (m != 0) {
                  break label544;
                }
                if (j != 0)
                {
                  k = (arrayOfBoolean2.length + i - 1) % arrayOfBoolean2.length;
                  arrayOfBoolean1[k] = true;
                  arrayOfBoolean2[k] = false;
                  if (n != 0) {
                    break label503;
                  }
                  if (m == 0) {
                    break;
                  }
                }
                i++;
              } while (m == 0);
            }
          }
          else
          {
            if (n != 0) {
              break label529;
            }
          }
        }
        else
        {
          i = 0;
          if (i < arrayOfBoolean1.length) {}
          while (n != 0)
          {
            if (m != 0) {
              break label410;
            }
            if (arrayOfBoolean1[i] != 0)
            {
              if (n != 0) {
                break label397;
              }
              if (arrayOfBoolean2[i] != 0) {
                arrayOfBoolean2[i] = false;
              }
            }
            i++;
            if (m == 0) {
              break;
            }
          }
          if (b(arrayOfBoolean2) == 0)
          {
            i = 0;
            do
            {
              if (i >= arrayOfBoolean1.length) {
                break;
              }
              j = arrayOfBoolean1[i];
              if (n != 0) {
                return;
              }
              if (m != 0) {
                break label544;
              }
              if (j != 0)
              {
                k = (i + 1) % arrayOfBoolean1.length;
                arrayOfBoolean2[k] = true;
                arrayOfBoolean1[k] = false;
                if (n != 0) {
                  break label503;
                }
                if (m == 0) {
                  break;
                }
              }
              i++;
            } while (m == 0);
          }
        }
        localad1 = a(localad1, a(arrayOfBoolean1));
        if (n != 0) {
          return;
        }
        label503:
        localad2 = a(localad1, a(arrayOfBoolean2));
      }
      else
      {
        paramCollection1.clear();
      }
    }
    label264:
    label397:
    label410:
    paramCollection1.add(localad1);
    label529:
    paramCollection2.clear();
    label544:
    paramCollection2.add(localad2);
  }
  
  private static int a(boolean[] paramArrayOfBoolean)
  {
    int j = g.Cc;
    int i = 0;
    if (j == 0) {
      if (paramArrayOfBoolean[0] != 0) {
        i |= 0x1;
      }
    }
    if (j == 0) {
      if (paramArrayOfBoolean[1] != 0) {
        i |= 0x4;
      }
    }
    if (j == 0) {
      if (paramArrayOfBoolean[2] != 0) {
        i |= 0x2;
      }
    }
    if (j == 0) {
      if (paramArrayOfBoolean[3] != 0) {
        i |= 0x8;
      }
    }
    return i;
  }
  
  private static boolean[] a(int paramInt)
  {
    int i = g.Cc;
    boolean[] arrayOfBoolean = new boolean[4];
    if (i == 0) {
      if ((paramInt & 0x1) != 0) {
        arrayOfBoolean[0] = true;
      }
    }
    if (i == 0) {
      if ((paramInt & 0x4) != 0) {
        arrayOfBoolean[1] = true;
      }
    }
    if (i == 0) {
      if ((paramInt & 0x2) != 0) {
        arrayOfBoolean[2] = true;
      }
    }
    if ((paramInt & 0x8) != 0) {
      arrayOfBoolean[3] = true;
    }
    return arrayOfBoolean;
  }
  
  private static int b(boolean[] paramArrayOfBoolean)
  {
    int m = g.Cc;
    int k = g.Bc;
    int i = 0;
    do
    {
      for (int j = 0; k == 0; j++)
      {
        if (j >= paramArrayOfBoolean.length) {
          break;
        }
        if (k != 0) {
          break label45;
        }
        if (paramArrayOfBoolean[j] != 0) {
          i++;
        }
      }
    } while (m != 0);
    label45:
    return i;
  }
  
  private static boolean a(ad paramad1, ad paramad2)
  {
    int i = g.Cc;
    if (i == 0) {
      if (paramad1.a(1))
      {
        if (i != 0) {
          break label103;
        }
        if (paramad2.a(1)) {
          break label102;
        }
      }
    }
    if (i == 0) {
      if (paramad1.a(2))
      {
        if (i != 0) {
          break label103;
        }
        if (paramad2.a(2)) {
          break label102;
        }
      }
    }
    if (i == 0) {
      if (paramad1.a(4))
      {
        if (i != 0) {
          break label103;
        }
        if (paramad2.a(4)) {
          break label102;
        }
      }
    }
    if ((i != 0) || (paramad1.a(8))) {
      if (i != 0) {}
    }
    label102:
    label103:
    return paramad2.a(8);
  }
  
  private static ad a(ad paramad, int paramInt)
  {
    if (g.Cc == 0) {
      if (paramad.b()) {
        return ad.a(paramad.c(), paramad.d(), paramInt, paramad.f());
      }
    }
    return ad.a(paramInt, paramad.f());
  }
  
  public static Collection a(a.f.o paramo, d paramd, Collection paramCollection, boolean paramBoolean)
  {
    int i = g.Cc;
    cd localcd;
    if (paramBoolean)
    {
      localcd = cd.d(paramo, paramd);
      localw = paramo.e(paramd).c();
      if (i == 0) {
        if (g.Bc == 0) {
          break label58;
        }
      }
    }
    else
    {
      localcd = cd.e(paramo, paramd);
    }
    w localw = paramo.e(paramd).d();
    label58:
    if ((i != 0) || (localcd != null))
    {
      ad localad = ad.a(localcd);
      if ((i != 0) || (localcd.a()))
      {
        localw = paramBoolean ? paramo.e(paramd).c() : paramo.e(paramd).d();
        localad = ad.a(localw.a, localw.b, localad.a());
      }
      if (i == 0) {
        if (paramCollection == null) {
          paramCollection = new ArrayList(1);
        }
      }
      paramCollection.add(localad);
    }
    return paramCollection;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.l.o

 * JD-Core Version:    0.7.0.1

 */